import request from '@/utils/request'

export function pageByRoleId(roleId, pageNum, pageSize) {
  return request({
    url: `/role-permit-relation/page/${roleId}`,
    method: 'get',
    params: Object.assign({}, { current: pageNum, size: pageSize })
  })
}

export function listByRoleId(roleId) {
  return request({
    url: `/role-permit-relation/${roleId}`,
    method: 'get'
  })
}

export function update(data) {
  return request({
    url: '/role-permit-relation',
    method: 'put',
    data
  })
}

export function remove(permitId, roleId) {
  return request({
    url: '/role-permit-relation',
    method: 'delete',
    params: Object.assign(
      {},
      {
        roleId: roleId,
        permitId: permitId
      }
    )
  })
}
